From a16c06e77e7bca689d800489324208a9fb71bde3 Mon Sep 17 00:00:00 2001 From: "emellor@leeni.uk.xensource.com" Date: Wed, 7 Dec 2005 15:41:41 +0000 Subject: [PATCH] Fix usleep definition -- we would be sleeping 1000 times too long if the usleep command were not available elsewhere on the machine (on my Debian boxes, for example). Sleep for a configurable amount of time between xm create calls (by default, 5 seconds). This spaces out the booting of the new domains, meaning that they should not thrash the disk so much. Signed-off-by: Ewan Mellor --- tools/examples/init.d/sysconfig.xendomains | 11 +++++++++++ tools/examples/init.d/xendomains | 4 +++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/tools/examples/init.d/sysconfig.xendomains b/tools/examples/init.d/sysconfig.xendomains index fa95c145cc..e93b1a40b9 100644 --- a/tools/examples/init.d/sysconfig.xendomains +++ b/tools/examples/init.d/sysconfig.xendomains @@ -20,6 +20,17 @@ XENDOMAINS_SYSRQ="" # XENDOMAINS_USLEEP=100000 +## Type: integer +## Default: 5000000 +# +# When creating a guest domain, it is sensible to allow a little time for it +# to get started before creating another domain or proceeding through the +# boot process. Without this, the booting guests will thrash the disk as they +# start up. This timeout (in microseconds) specifies the delay after guest +# domain creation. +# +XENDOMAINS_CREATE_USLEEP=5000000 + ## Type: string ## Default: "" # diff --git a/tools/examples/init.d/xendomains b/tools/examples/init.d/xendomains index 4d7db36295..23d53efea4 100644 --- a/tools/examples/init.d/xendomains +++ b/tools/examples/init.d/xendomains @@ -127,7 +127,7 @@ then { if [ -n "$1" ] then - sleep $(( $1 / 1000 )) + sleep $(( $1 / 1000000 )) fi } fi @@ -241,6 +241,8 @@ start() if [ $? -ne 0 ]; then rc_failed $? echo -n '!' + else + usleep $XENDOMAINS_CREATE_USLEEP fi fi done -- 2.30.2